<template>
  <ContentWrap class="w-50%">
    <el-descriptions :column="1" :size="size" border>
    <el-descriptions-item label="模块名称">{{moduleInfo.name}}</el-descriptions-item>
    <el-descriptions-item label="状态">{{moduleInfo.status == 0 ? '未启用' : '启用'}}</el-descriptions-item>
    <el-descriptions-item label="使用范围">
      <span v-if="moduleInfo.type == 0">全公司</span>
      <span v-if="moduleInfo.type == 1">指定部门</span>
      <span v-if="moduleInfo.type == 2">指定员工</span>
    </el-descriptions-item>
    <el-descriptions-item label="指定部门">{{moduleInfo.deptName}}</el-descriptions-item>
    <el-descriptions-item label="指定员工">{{moduleInfo.userName}}</el-descriptions-item>
    <el-descriptions-item label="更新时间">{{formatDate(moduleInfo.updateTime)}}</el-descriptions-item>
    <el-descriptions-item label="创建时间">{{formatDate(moduleInfo.createTime)}}</el-descriptions-item>
    </el-descriptions>
  </ContentWrap>
</template>
<script setup lang="ts">
import { formatDate } from '@/utils/formatTime'

defineOptions({ name: 'ModuleInfo' })

const props = defineProps({
  moduleInfo: {
    type: Object,
    default: () => ({})
  }
})

// watch(
//   () => props.moduleInfo,
//   (val) => {
//   },
//   { immediate: true }
// )

</script>
<style lang="scss" scoped>


:deep(.el-descriptions__label) {
  width: 100px;

}
</style>